/*
 * Powered By [rapid-framework]
 * Web Site: http://www.rapid-framework.org.cn
 * Google Code: http://code.google.com/p/rapid-framework/
 * Since 2008 - 2013
 */

package org.teacup.eightdays.model;

import javax.persistence.*;

import org.hibernate.annotations.GenericGenerator;

import javax.validation.constraints.*;
import org.hibernate.validator.constraints.*;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

import java.util.*;

import javacommon.base.*;
import javacommon.util.*;

import cn.org.rapid_framework.util.*;
import cn.org.rapid_framework.web.util.*;
import cn.org.rapid_framework.page.*;
import cn.org.rapid_framework.page.impl.*;

import org.teacup.eightdays.model.*;
import org.teacup.eightdays.dao.*;
import org.teacup.eightdays.service.*;
import org.teacup.eightdays.vo.query.*;

/**
 * @author Abner email:521yexu2008(a)163.com
 * @version 1.0
 * @since 1.0
 */

@Entity
@Table(name = "manager")
public class Manager extends BaseEntity implements java.io.Serializable{
	private static final long serialVersionUID = 5454155825314635342L;
	
	//alias
	public static final String TABLE_ALIAS = "Manager";
	public static final String ALIAS_MANAGER_ID = "ID";
	public static final String ALIAS_LOGINNAME = "管理员账号";
	public static final String ALIAS_LOGINPASSWORD = "管理员密码";
	public static final String ALIAS_STATUS = "状态";
	
	//date formats
	

	//可以直接使用: @Length(max=50,message="用户名长度不能大于50")显示错误消息
	//columns START
    /**
     * ID       db_column: manager_id 
     */ 	
	
	private java.lang.Long managerId;
    /**
     * 管理员账号       db_column: loginname 
     */ 	
	@NotBlank @Length(max=255)
	private java.lang.String loginname;
    /**
     * 管理员密码       db_column: loginpassword 
     */ 	
	@Length(max=255)
	private java.lang.String loginpassword;
    /**
     * 状态       db_column: status 
     */ 	
	
	private java.lang.Integer status;
	//columns END


	public Manager(){
	}

	public Manager(
		java.lang.Long managerId
	){
		this.managerId = managerId;
	}

	

	public void setManagerId(java.lang.Long value) {
		this.managerId = value;
	}
	
	@Id @GeneratedValue(generator="custom-id")
	@GenericGenerator(name="custom-id", strategy = "increment")
	@Column(name = "manager_id", unique = true, nullable = false, insertable = true, updatable = true, length = 19)
	public java.lang.Long getManagerId() {
		return this.managerId;
	}
	
	@Column(name = "loginname", unique = false, nullable = false, insertable = true, updatable = true, length = 255)
	public java.lang.String getLoginname() {
		return this.loginname;
	}
	
	public void setLoginname(java.lang.String value) {
		this.loginname = value;
	}
	
	@Column(name = "loginpassword", unique = false, nullable = true, insertable = true, updatable = true, length = 255)
	public java.lang.String getLoginpassword() {
		return this.loginpassword;
	}
	
	public void setLoginpassword(java.lang.String value) {
		this.loginpassword = value;
	}
	
	@Column(name = "status", unique = false, nullable = true, insertable = true, updatable = true, length = 10)
	public java.lang.Integer getStatus() {
		return this.status;
	}
	
	public void setStatus(java.lang.Integer value) {
		this.status = value;
	}
	

	public String toString() {
		return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
			.append("ManagerId",getManagerId())
			.append("Loginname",getLoginname())
			.append("Loginpassword",getLoginpassword())
			.append("Status",getStatus())
			.toString();
	}
	
	public int hashCode() {
		return new HashCodeBuilder()
			.append(getManagerId())
			.toHashCode();
	}
	
	public boolean equals(Object obj) {
		if(obj instanceof Manager == false) return false;
		if(this == obj) return true;
		Manager other = (Manager)obj;
		return new EqualsBuilder()
			.append(getManagerId(),other.getManagerId())
			.isEquals();
	}
}

